package com.miszczu.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.miszczu.model.Subjects;
import com.miszczu.utils.CustomHibernateSupport;

@Repository
public class SubjectsDaoImpl extends CustomHibernateSupport implements SubjectsDao {

	public void save(Subjects subject) {

		getHibernateTemplate().save(subject);

	}

	public List<Subjects> getAllSubjects() {
		
		return getHibernateTemplate().find("from Subjects");
		
	}

	public Subjects getOne(Integer id) {

		return getHibernateTemplate().get(Subjects.class, id);
	}

	public void delete(Subjects subject) {
		
		getHibernateTemplate().delete(subject);
		
	}

	public void update(Subjects subject) {
		
		getHibernateTemplate().update(subject);
		
	}

	

}
